<template>
  <v-container fluid>
    <v-row>
      <v-col cols="12">
        <v-breadcrumbs :items="items"></v-breadcrumbs>
      </v-col>
      <v-col cols="12">
          <div v-html="text" class="px-5"></div>
      </v-col>
    </v-row>
  </v-container>
</template>

<script>
const showdown = require("showdown");
const convert = new showdown.Converter();

export default {
  name: "Version",
  data() {
    return {
      items: [
        {
          text: "首页",
          disabled: false,
          exact: true,
          to: { name: "Home" },
        },
        {
          text: "时间线",
          disabled: true,
          exact: true,
          to: { name: "Version" },
        },
      ],
      text: "",
    };
  },
  methods: {
    generateVersionDoc() {
      const that = this;
      this.axios.get("/version.md").then(function (response) {
        that.text = Object.freeze(convert.makeHtml(response.data));
      });
    },
  },
  created() {
    this.generateVersionDoc();
  },
};
</script>